import request from '@/utils/request'
const url = 'v1/User'
// 登录
export function userLogin(loggingName, passWord) {
  return request.get(`${url}/LoginUserByNamePwd/${loggingName}/${passWord}`)
}
export function getUserInfo(id) {
  return request.get(`${url}/GetUserById/${id}`)
}
export function getAllUsers() {
  return request.get(`${url}/GetAllUser`)
}

// 获取所有的超级管理员
export function getSuperAdmins() {
  return request.get(`${url}/GetSuperAdmins`)
}
// 获取集团级
export function getAdmins() {
  return request.get(`${url}/GetAdmins`)
}

// 根据上一级pid获取下一级用户对象
export function getUserByPId(pid) {
  return request.get(`${url}/GetUserByPId/${pid}`)
}

// 获取没有集团的公司级用户
export function getCompanys() {
  return request.get(`${url}/GetCompanys`)
}

export function addUser(data) {
  return request.post(`${url}/AddUser`, data)
}

export function updateUser(data) {
  return request.post(`${url}/UpdateUser`, data)
}

export function delUserById(id) {
  return request.post(`${url}/DelUserById`, id)
}
